package router

import (
	"github.com/gin-gonic/gin"
	v1 "perfect-vue-admin/api/v1"
	"perfect-vue-admin/middleware"
)

func InitUserRouter(Router *gin.RouterGroup) {
	UserRouter := Router.Group("user").Use(middleware.JWTAuth()).
		Use(middleware.CasbinHandler()).
		Use(middleware.OperationRecord())
	{
		UserRouter.DELETE("deleteUser", v1.DeleteUser)           // 删除用户
		UserRouter.DELETE("batchDeleteUsers", v1.DeleteUserList) // 批量删除用户
		UserRouter.DELETE("cleanUsers", v1.CleanUsers)			 // 清空用户
		UserRouter.PUT("uploadUserAvatar", v1.UploadUserAvatar) // 上传用户头像
		UserRouter.PUT("setUserInfo", v1.SetUserInfo)            // 设置用户信息
		UserRouter.PUT("setUserState", v1.SetUserState)			 // 设置用户状态
		UserRouter.PUT("changePassword", v1.ChangePassword)     // 修改密码
		UserRouter.GET("getUserList", v1.GetUserList)           // 分页获取用户列表
		UserRouter.GET("getUserListByIds", v1.GetUserListByIds)  // 批量获取用户
		UserRouter.POST("register", v1.Register)				 // 用户注册
		//UserRouter.PUT("setUserAuthority", v1.SetUserAuthority) // 设置用户权限
	}
}

